package edu.sctu.practice.class02.yangyuran.assign03.assign3_02;

/**
 * Created by Administrator on 2015/10/23.
 */
public class Test {
    public static void main(String[] args) {
        ComparableCircle circle1 = new ComparableCircle(5.0);
        ComparableCircle circle2 = new ComparableCircle(4.0);
        Comparable circle = Max.max(circle1, circle2);
        System.out.println("最大圆：" + "\n" + "\t" + "半径为：" + ((Circle) circle).getRadius());
        System.out.println("\t" + "面积为" + ((Circle) circle).getArea());
        System.out.println();

        ComparableCylinder cylinder1 = new ComparableCylinder(2.0, 3.0);
        ComparableCylinder cylinder2 = new ComparableCylinder(3.0, 4.0);
        Comparable cylinder = Max.max(cylinder1, cylinder2);
        System.out.println("最大圆柱：" + "\n" + "\t" + "半径为：" + ((Cylinder) cylinder).getRadius());
        System.out.println("\t" + "高为：" + ((Cylinder) cylinder).getHeight());
        System.out.println("\t" + "面积为：" + ((Cylinder) cylinder).getVolume());
    }
}
